<script setup lang="ts">
import { onMounted } from "vue";
import { useSysApi } from "./useSysApi";

const modelValue = defineModel({ type: Array<string> });
const emit = defineEmits(["change"]);
const { query, apiList, reloadApiList } = useSysApi();

onMounted(() => {
  reloadApiList();
});
</script>

<template>
  <el-transfer
    v-model="modelValue"
    :data="apiList"
    :titles="['未绑定Api', '已绑定Api']"
    :button-texts="['移除', '添加']"
    :props="{
      key: 'id',
      label: 'title'
    }"
    filterable
    @change="value => emit('change', value)"
  />
</template>
<style lang="scss" scoped></style>
